package com.xzy.service.impl;

import com.xzy.custom.Page;
import com.xzy.entities.BorrowRecord;
import com.xzy.mapper.BorrowRecordMapper;
import com.xzy.service.BorrowRecordService;
import com.xzy.web.form.BorrowRecordForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * TODO70
 *
 * @author Administrator
 * ClassName: BorrowRecordServiceImpl
 * date: 2021/11/23 14:43
 */
@Service
public class BorrowRecordServiceImpl implements BorrowRecordService {

    @Autowired
    private BorrowRecordMapper borrowMapper;

    @Override
    public List<BorrowRecord> findAll() {
        return borrowMapper.findAll();
    }

    @Override
    public Integer findBorrowCount(Page page,String name) {
        return borrowMapper.findBorrowCount(page,name);
    }

    @Override
    public List<BorrowRecord> findAllBorrow(Page page,String name) {
        return borrowMapper.findAllBorrow(page,name);
    }

    @Override
    public void insertBorrowRecord(BorrowRecordForm form) {
        borrowMapper.insertBorrowRecord(form);
    }

    @Override
    public List<Integer> findByUserId(Integer userId) {
        return borrowMapper.findByUserId(userId);
    }

    @Override
    public void insertOperation(BorrowRecordForm form) {
        borrowMapper.insertOperation(form);
    }

    @Override
    public void updateStatus(Integer borrowId) {
        borrowMapper.updateStatus(borrowId);
    }

    @Override
    public List<BorrowRecord> findAllDeWeight() {
        return borrowMapper.findAllDeWeight();
    }
}

